In parallel programming computing environments, sharing access to the same memory locations requires proper management and synchronization, which can be relatively difficult to perform. Traditionally, synchronization between threads accessing shared memory has been realized using locks to protect shared data from simultaneous access. However, locks are often overly conservative in their serialization to shared data, which might not always be necessary at run-time, but is often challenging or impossible to determine when code is written.
Transactional memory has been proposed as an alternative solution, to allow threads to speculatively execute critical sections, called transactions, in parallel. If a conflict occurs at run-time, threads stall or roll back their transactions and execute them again to resolve the conflict. In transactional memory systems, threads can speculatively execute transactions without altering the contents of shared memory locations until the transactions subsequently commit. If a conflict is detected between two transactions, one of the transactions may be aborted so that the other transaction can commit, at which time the committed transaction may alter the contents of the shared memory locations.